package com.softhinker.ke24.unit1;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.net.URL;

import javax.swing.ImageIcon;
import javax.swing.JPanel;

public class Cover extends JPanel 
{
	private static final long serialVersionUID = -8010047206391632686L;

	public void paintComponent(Graphics g) 
    {
		URL url = this.getClass().getResource("/images/background.png");
        Image img = new ImageIcon(url).getImage();
        Dimension size = new Dimension(img.getWidth(null), img.getHeight(null));
        setPreferredSize(size);
        setMinimumSize(size);
        setMaximumSize(size);
        setSize(size);
        setLayout(null);
        g.drawImage(img, 0, 0, null);
    } 
	
}
